﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="MyWeb.login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>销售管理系统</title>
    <link rel="stylesheet" type="text/css" href="Styles/base.css" />
    <link rel="stylesheet" type="text/css" href="Styles/admin-all.css" />
    <link rel="stylesheet" type="text/css" href="Styles/bootstrap.min.css" />
    <script type="text/javascript" src="Scripts/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="Scripts/jquery.spritely-0.6.js"></script>
    <script type="text/javascript" src="Scripts/chur.min.js"></script>
    <link rel="stylesheet" type="text/css" href="Styles/login.css" />
    <script type="text/javascript">
        $(function () {
            $('#clouds').pan({ fps: 20, speed: 0.7, dir: 'right', depth: 10 });
            $('.login').click(function () {
                if ($('#uid').val() == "" || $('#pwd').val() == "") { $('.tip').html('用户名或密码不可为空！'); return; }
                $.ajax({
                    type: "POST",
                    url: "handler/loginHander.ashx?M=" + Math.random(),
                    data: "username=" + $("#uid").val().toString() + "&pwd=" + $("#pwd").val().toString(),
                    success: function (data) {
                        if (data == "1") {
                            location.href = "index.aspx";
                        }
                        else {
                            $('body').alert({
                                type: 'danger',
                                content: '用户名或密码错误！'
                            })
                            $("#uid").val("");
                            $("#pwd").val("");
                            $("#uid").focus();
                        }
                    }

                })
            })
            $('#reset').click(function () {
                document.getElementById("uid").value = "";
                document.getElementById("pwd").value = ""
            })
            document.onkeydown = function (event_e) {
                if (window.event)
                    event_e = window.event;
                var int_keycode = event_e.charCode || event_e.keyCode;
                if (int_keycode == 13) {
                    $('.login').click();
                }
            }
        })
    </script>
</head>
<body>
    <div id="clouds" class="stage"></div>
    <div class="loginmain">
    </div>

    <div class="row-fluid">
        <h1>销售管理系统</h1>
        <p>
            <label>帐&nbsp;&nbsp;&nbsp;号：<input type="text" id="uid" /></label>
        </p>
        <p>
            <label>密&nbsp;&nbsp;&nbsp;码：<input type="password" id="pwd" /></label>
        </p>
        <p class="pcode">
            <%--<label>效验码：<input type="text" id="code" maxlength="5" class="code" value="e5g88" /><img src="img/code.gif" alt="" class="imgcode" /><a href="#">下一张</a></label>--%>
        </p>
        <p class="tip">&nbsp;</p>
        <hr />
        <input type="button" value=" 登 录 " class="btn btn-primary btn-large login" />
        &nbsp;&nbsp;&nbsp;<input type="button" id="reset" value=" 重 置 " class="btn btn-large" />
    </div>
</body>
</html>

